package net.optix.ip.commands
{
	import com.adobe.cairngorm.business.Responder;
	import com.adobe.cairngorm.commands.Command;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.adobe.cairngorm.control.CairngormEventDispatcher;
	
	import mx.controls.Alert;
	
	import net.optix.ip.business.*;
	import net.optix.ip.model.ModelLocator;
	import views.ViewInstance;
	
	public class LogOutCommand implements Command, Responder
	{
		// attributes ============================
		private var model : ModelLocator = ModelLocator.getInstance();


		// functions ============================
		public function execute( event:CairngormEvent ) : void
		{
			trace("world");
			model.role	=	0;
			model.user	=	null;
			model.client=	null;
			model.inventor=	null;
			model.firm	=	null;
			model.practitioner	=	null;
			
			model.inventions	=	null;
			
			model.view	=	0;
			model.view	=	ViewInstance.Welcome;
			
			model.result	=	"";
			model.bSubmit	=	true;
		}
		
		//----------------------------------------------------------------------------
		public function onResult( event : * = null ) : void
		{
			
		}
		
		//----------------------------------------------------------------------------
		public function onFault( event : * = null ) : void
		{
			
		}

	}
}